home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
58519
/
58519.xpi
/
chrome
/
nasatabs.jar
/
content
/
tabs.xml
< prev
Wrap
Extensible Markup Language
|
2010-01-15
|
9KB
|
224 lines
<?xml version="1.0"?>
<!DOCTYPE bindings [
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd">
%tabBrowserDTD;
]>
<bindings id="nasatabs" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="nasa-tab" display="xul:hbox" extends="chrome://global/content/bindings/tabbox.xml#tab">
<content chromedir="&locale.dir;" closetabtext="&closeTab.label;">
<xul:hbox class="tab-image-left tab-startcap tab-left tab-left-border" xbl:inherits="selected,hover"/>
<xul:hbox class="tab-drag-indicator-left"/>
<xul:toolbarbutton anonid="tmp-close-button" tabindex="-1" class="tab-close-button always-left"/>
<xul:hbox flex="1" class="tab-middle box-inherit tab-image-middle tab-body" align="center" xbl:inherits="selected">
<xul:stack class="tab-icon">
<xul:image class="tab-icon-image" xbl:inherits="validate,src=image"/>
<xul:image class="tab-protect-icon"/>
<xul:image class="tab-lock-icon"/>
</xul:stack>
<xul:stack class="tab-text-stack" flex="1">
<xul:progressmeter class="tab-progress" flex="2" mode="normal" value="0" xbl:inherits="value=tab-progress"/>
<xul:label class="tab-text" xbl:inherits="value=label,accesskey,crop,disabled" flex="1"/>
<xul:hbox class="showhover-box">
<xul:toolbarbutton anonid="tmp-close-button" tabindex="-1" class="showhover tabs-closebutton"/>
</xul:hbox>
</xul:stack>
</xul:hbox>
<xul:toolbarbutton anonid="tmp-close-button" tabindex="-1" class="tab-close-button always-right"/>
<xul:hbox class="tab-drag-indicator-right"/>
<xul:hbox class="tab-image-right tab-endcap tab-right tab-right-border" xbl:inherits="selected,hover"/>
</content>
<implementation>
<field name="mOverCloseButton">
false
</field>
<field name="mIsHover">
false
</field>
<field name="mButtonId">
0
</field>
<field name="mFocusId">
0
</field>
<field name="mSelect">
0
</field>
<property name="mouseHoverSelect" readonly="true">
<getter><![CDATA[
try {
return gTabmixPrefs.getBoolPref("extensions.tabmix.mouseOverSelect");
}
catch(e) {
return false;
}
]]></getter>
</property>
<property name="mouseDownSelect" readonly="true">
<getter><![CDATA[
try {
return gTabmixPrefs.getBoolPref("extensions.tabmix.mouseDownSelect");
}
catch(e) {
return false;
}
]]></getter>
</property>
<property name="mouseHoverSelectDelay" readonly="true">
<getter><![CDATA[
try {
return gTabmixPrefs.getIntPref("extensions.tabmix.mouseOverSelectDelay");
}
catch(e) {
return 250;
}
]]></getter>
</property>
<property name="tabXDelay" readonly="true">
<getter><![CDATA[
try {
return gTabmixPrefs.getIntPref("extensions.tabmix.tabXDelay");
}
catch(e) {
return 0;
}
]]></getter>
</property>
<property name="baseY" readonly="true" onget="return this.boxObject.y+this.boxObject.height;"/>
<method name="onMouseOver">
<parameter name="aEvent"/>
<body><![CDATA[
var anonid = aEvent.originalTarget.getAttribute("anonid");
if (anonid == "tmp-close-button")
this.mOverCloseButton = true;
this.mIsHover = true;
this.mButtonId = window.setTimeout(this.setShowButton, this.tabXDelay, this);
if (this.mouseHoverSelect)
this.mFocusId = window.setTimeout(this.doMouseHoverSelect, this.mouseHoverSelectDelay, this);
]]></body>
</method>
<method name="doMouseHoverSelect">
<parameter name="aTab"/>
<body><![CDATA[
if (!aTab || !aTab.parentNode)
return;
var b = aTab.parentNode.parentNode.parentNode.parentNode;
if (b.hasAttribute("preventMouseHoverSelect"))
b.removeAttribute("preventMouseHoverSelect");
else if (aTab.mIsHover)
aTab.parentNode.selectedItem = aTab;
]]></body>
</method>
<method name="setShowButton">
<parameter name="aTab"/>
<body><![CDATA[
if (!aTab || !aTab.parentNode)
return;
if ( aTab.mIsHover && aTab.getAttribute("showbutton") != "on")
aTab.setAttribute("showbutton", "on");
]]></body>
</method>
<method name="onMouseOut">
<parameter name="aEvent"/>
<body><![CDATA[
var anonid = aEvent.originalTarget.getAttribute("anonid");
if (anonid == "tmp-close-button")
this.mOverCloseButton = false;
this.mIsHover = false;
clearTimeout(this.mButtonId);
this.mButtonId = window.setTimeout(this.removeShowButton, this.tabXDelay, this);
if (this.mouseHoverSelect && this.mFocusId)
clearTimeout(this.mFocusId);
]]></body>
</method>
<method name="removeShowButton">
<parameter name="aTab"/>
<body><![CDATA[
if (!aTab || !aTab.parentNode)
return;
if (!aTab.mIsHover && aTab.getAttribute("showbutton") != "off")
aTab.setAttribute("showbutton", "off");
]]></body>
</method>
<method name="onMouseCommand">
<parameter name="aEvent"/>
<body><![CDATA[
if ( this == this.parentNode.selectedItem ) {
this.setAttribute("clickOnCurrent","true");
}
else if (!aEvent.shiftKey && !aEvent.ctrlKey && !aEvent.altKey && !aEvent.metaKey) {
function TMclickSetTab(tab) {
if (tab.parentNode)
tab.parentNode._selectNewTab(tab);
}
this.mSelect = setTimeout(TMclickSetTab, 0, this);
}
]]></body>
</method>
<method name="clearTimeouts">
<body><![CDATA[
let timeouts = ["mSelect", "mFocusId", "mButtonId", "autoReloadTimerID"];
timeouts.forEach(function(aTimeout) {
if (aTimeout in this && this[aTimeout]) {
clearTimeout(this[aTimeout]);
this[aTimeout] = null;
}
});
this.removeEventListener("mousedown", this.TMP_mousedownEventHandler, true);
]]></body>
</method>
<field name="TMP_mousedownEventHandler" readonly="true">
<![CDATA[({
mTab: this,
handleEvent: function handleEvent(aEvent) {
if (aEvent.button != "0" || aEvent.target.localName != "tab")
return;
var anonid = aEvent.originalTarget.getAttribute("anonid");
if (this.mTab != this.mTab.parentNode.selectedItem && anonid != "tmp-close-button" &&
(aEvent.shiftKey || aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey)) {
return;
}
if (this.mTab.mouseDownSelect && anonid != "tmp-close-button")
return;
}
})]]>
</field>
<constructor>
<![CDATA[
if (this._inited)
return;
this._inited = true;
this.addEventListener("mousedown", this.TMP_mousedownEventHandler, true);
]]>
</constructor>
<destructor>
<![CDATA[
this.clearTimeouts();
]]>
</destructor>
</implementation>
<handlers>
<handler event="mouseover">
<![CDATA[
this.onMouseOver(event);
]]>
</handler>
<handler event="mouseout">
<![CDATA[
this.onMouseOut(event);
]]>
</handler>
<handler event="click" button="0">
<![CDATA[
var anonid = event.originalTarget.getAttribute("anonid");
if (anonid != "tmp-close-button" && !this.mouseDownSelect) {
this.onMouseCommand(event);
}
]]>
</handler>
</handlers>
</binding>
</bindings>